Skip to content

feat: implement block decoding and refactor encoding layer#59

Merged
b00f merged 1 commit into
mainfrom
feat/block-decode-encoding
Jun 30, 2026
Merged

feat: implement block decoding and refactor encoding layer#59
b00f merged 1 commit into
mainfrom
feat/block-decode-encoding

Conversation

@b00f

@b00f b00f commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator
  • Add block decode: Header, Certificate, and Transaction decoding from raw bytes
  • Refactor encoding to consume-buffer pattern (value, buf) instead of offset tracking
  • Split transaction payloads into separate module (pactus/transaction/payload/)
  • Add Hash (32-byte) type under pactus/crypto with encode/decode
  • Add encode/decode to Height, Round, and Amount types
  • Add encode/decode to all crypto types (BLS/Ed25519/Secp256k1 Signature & PublicKey)
  • Add abstract encode/decode to base PublicKey and Signature ABCs
  • Add Round and Height value types under pactus/types/
  • Make Amount._round private
  • Fix treasury Address.from_string returning raw bytes instead of Address
  • Add test_block.py decoding a full block from raw hex data
  • Update test_encoding.py with read tests

- Add block decode: Header, Certificate, and Transaction decoding from raw bytes
- Refactor encoding to consume-buffer pattern (value, buf) instead of offset tracking
- Split transaction payloads into separate module (pactus/transaction/payload/)
- Add Hash (32-byte) type under pactus/crypto with encode/decode
- Add encode/decode to Height, Round, and Amount types
- Add encode/decode to all crypto types (BLS/Ed25519/Secp256k1 Signature & PublicKey)
- Add abstract encode/decode to base PublicKey and Signature ABCs
- Add Round and Height value types under pactus/types/
- Make Amount._round private
- Fix treasury Address.from_string returning raw bytes instead of Address
- Add test_block.py decoding a full block from raw hex data
- Update test_encoding.py with read tests
@b00f b00f force-pushed the feat/block-decode-encoding branch from 508ddf7 to 9a8760c Compare June 30, 2026 18:49
@b00f b00f merged commit 949eb0b into main Jun 30, 2026
3 checks passed
@b00f b00f deleted the feat/block-decode-encoding branch June 30, 2026 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant